<template>
  <view class="historyToday">
    <!--  标题  -->
    <scroll-view class="historyToday_scroll " :scroll-y="true" :style="{
      height: `calc(100vh - ${headerHeight}px)`
    }">
      <view class="historyToday_scroll_all flex flex-column align-center">
        <view class="hW_32"></view>
        <view class="historyToday_scroll_title flex align-center justify-center">
          <text class="historyToday_scroll_title_text">
            {{ detail.title }}
          </text>
        </view>
        <view class="hW_32"></view>
        <view class="historyToday_scroll_time">
          <text class="historyToday_scroll_time_text">
            历史时间：{{ dayjs(`${detail.year}-${detail.time}`).format('YYYY年MM月DD日') }}
          </text>
        </view>
        <view class="hW_32"></view>
        <view class="historyToday_scroll_content">
          <mp-html :content="detail.content"></mp-html>
        </view>
        <view class="hW_50"></view>
      </view>
    </scroll-view>
  </view>
</template>

<script>
  import dayjs from "dayjs";
  import sheep from '@/sheep';
  import MpHtml from '@/uni_modules/mp-html/components/mp-html/mp-html.vue';

  export default {
    components: { MpHtml },
    data() {
      return {
        headerHeight: sheep.$platform.navbar
      };
    },
    props:{
      detail: {
        type: Object,
        default: ()=>{}
      },
      options:{
        type: Object,
        default: ()=>{}
      }
    },
    methods: {
      dayjs,
    },
  }
</script>

<style lang="scss">
  .historyToday_scroll {
    width: 750rpx;
    background: #FBF3E1;

    .historyToday_scroll_all {
      width: 750rpx;

      .historyToday_scroll_title {
        width: 702rpx;

        .historyToday_scroll_title_text {
          font-family: PingFang SC, PingFang SC;
          font-weight: 600;
          font-size: 30rpx;
          color: #66584D;
        }
      }

      .historyToday_scroll_time {
        width: 702rpx;

        .historyToday_scroll_time_text {
          font-family: PingFang SC, PingFang SC;
          font-weight: 400;
          font-size: 26rpx;
          color: #66584D;
        }
      }

      .historyToday_scroll_content {
        width: 702rpx;
        font-family: PingFang SC, PingFang SC;
        font-weight: 500;
        font-size: 34rpx;
        color: #606060;
        line-height: 50rpx;
      }
    }

  }
</style>
